/*
	编程实现双色球抽奖游戏中奖号码的生成
*/
import java.util.Random;
import java.util.Arrays;
public class DoubleBallsTest {
	public static void main(String[] args) {
		// 1、声明红球号码数组，类型为int,并初始化
		int[] red_ball = new int[6];
		// 2、生成随机数1~33并填入数组
		Random ra = new Random();
		for (int i = 0; i < red_ball.length; i++) {
			int temp = ra.nextInt(33) + 1;
			// 判断该数是否已存在
			for (int j = 0; j < i; j++) {
				// 使用while循环判断，若存在就换随机号码
				while(temp == red_ball[j]) {
					temp = ra.nextInt(33) + 1;
				}
			}
			red_ball[i] = temp;
		}
		Arrays.sort(red_ball);
		System.out.print("红球号码是：" );
		for (int i = 0; i < red_ball.length; i++) {
			System.out.print(red_ball[i] + " ");	
		}
		System.out.println();
		int blue_ball = ra.nextInt(16) + 1;
		System.out.print("蓝球号码是：" + blue_ball);
	}
}